using System;
using System.Collections.ObjectModel;
using Facebook.Core.Contracts;

namespace Facebook.Fluent
{
    public class LogicalOperator<T>
    {
        public FQLQuery Query { get; set; }

        public LogicalOperator(FQLQuery query)
        {
            Query = query;
        }

        public ComparisonOperator<T> And(Enum field)
        {
            Query.AddAnd(field);
            return new ComparisonOperator<T>(Query);
        }

        public Collection<T> Execute(IFacebookService service)
        {
            return service.FQLQuery<T>(Query.GetQuery());
        }
    }
}